package jdk8demo;

import jdk8demo.interfacefunction.FunctionalInterfaceDemo1;

public class InterfaceDemo {

	public static void main(String[] args) {
		FunctionalInterfaceDemo1 d = () -> System.out.println("Hello");
		d.test();
		int v = 5;
		PlusInterface p = a -> v + a;
		System.out.println(p.plus(10));
//		v = 16; 在lambda中使用的变量不能被赋值，相当于final变量
	}
}

interface PlusInterface {
	public int plus(int a);
}
